Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove not found __arg2 #108

Merged
merged 1 commit into from
Jun 6, 2022
Merged

remove not found __arg2 #108

merged 1 commit into from
Jun 6, 2022

Conversation

secana
Copy link
Contributor

@secana secana commented Jun 3, 2022

Fix compilation error with rocket_cors ="0.6.0-alpha1" and rocket = "0.5.0-rc.2" on rustc 1.61.0.

Compiling rocket_cors v0.6.0-alpha1
error[E0425]: cannot find value `__arg2` in this scope
  --> /home/_/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket_cors-0.6.0-alpha1/src/fairing.rs:29:18
   |
29 |         let _ = &__arg2;
   |                  ^^^^^^ not found in this scope

error[E0425]: cannot find value `__arg2` in this scope
    --> /home/_/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket_cors-0.6.0-alpha1/src/lib.rs:1997:18
     |
1997 |         let _ = &__arg2;
     |                  ^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `rocket_cors` due to 2 previous errors

@lawliet89 lawliet89 requested a review from ELD June 3, 2022 11:56
Copy link
Collaborator

@ELD ELD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm puzzled how that line got added in the first place. Looks like it was part of #105 but I'm perplexed why that was added in the first place.

Anyhow, the clippy lints are a little concerning, but I can't figure out easily why those are failing.

@secana
Copy link
Contributor Author

secana commented Jun 4, 2022

If I can help in any way, let me know. All I can tell is that removing those to lines fix it for me and it compiles and runs fine on my machines.

@tekkusan
Copy link

tekkusan commented Jun 4, 2022

Just as a comment (since I'm having the same issue and have "fixed" it by removing those lines) is that while I don't see any recent changes in the repository or at crates.io, apparently this exact same code was working up until yesterday? The same Github Action I've been using (that compiles and deploys a backend which uses rocket_cors) was working fine for weeks and then failed to compile yesterday.

Any idea what caused the change?

@ELD
Copy link
Collaborator

ELD commented Jun 5, 2022

@secana From what I can see with regard to __argX style variables, this was a symptom of async desugaring. However, I don't know why it hadn't broken until now since it appears the PR to fix it was merged a long time ago (rust-lang/rust#60438). I don't know how an updated version of Rocket would have changed things. Either way, removing the lines appears to be proper. I think the edition fix tool went a little overboard with adding random lines.

@tekkusan Are you using the stable or nightly compiler?

@ELD
Copy link
Collaborator

ELD commented Jun 5, 2022

Okay, I think I tracked down the clippy linter errors. It seems to be a combination of updating to Rocket 0.5-rc.2 and Hyper.

I'm going to see if I can take a stab at upgrading and then layering this PR on top.

@tekkusan
Copy link

tekkusan commented Jun 5, 2022

@tekkusan Are you using the stable or nightly compiler?

Stable... On my local builds (which also started failing at the same time) I was using 1.60 and updated to 1.61 "just in case" (but made no difference)... On the Github Action, whatever "ubuntu-latest" has in it, but I would assume it's either 1.60 or 1.61.

@ELD
Copy link
Collaborator

ELD commented Jun 5, 2022

@tekkusan Yeah, 1.61 is what's being run by the GHA on this repo. It works when I don't run a cargo update on the repo, but the clippy lint failures and build failures trigger when I do run the cargo update command. Given it's a library, the dependency versions will always float.

I'm going to try to fix it, incorporate this PR, and then get this crate building with Rocket 0.5-rc.2 again 😄

@tekkusan
Copy link

tekkusan commented Jun 5, 2022

I'm going to try to fix it, incorporate this PR, and then get this crate building with Rocket 0.5-rc.2 again 😄

For the record, I had been using rc.2 for a while (since I saw it was out, actually) and it was building fine (without clippy at least, which I am not running)... It literally broke last friday, and when I came here to see what was going on, I saw @secana PR.

Like you said, those lines have been there "forever" so I have no clue why it would "suddenly" stop compiling 🤷‍♂️

@ELD
Copy link
Collaborator

ELD commented Jun 5, 2022

@tekkusan I think I found it. It's an issue with async_trait. It seems that the drop order was messed with when upgrading to Rust 2021 from 2018. Looks like it's patched, which might be why those __argX variables are no longer visible to the user: dtolnay/async-trait#199

Edit: it's this PR that fixes the positional argument issue: dtolnay/async-trait#202

@tekkusan
Copy link

tekkusan commented Jun 5, 2022

Oh, I see... As a fairly new Rust coder this is way above my paygrade (in my book, async-trait is an unavoidable arcane incantation), but I do get the general idea of what happened and that commit 3 days ago indeed suggests that it was the trigger for those lines to actually start failing.

@ELD
Copy link
Collaborator

ELD commented Jun 5, 2022

@tekkusan Yep, at the very least, the removal of the lines fixes the positional arg errors, but there are more errors with regard to Hyper exports, it seems. I'll look into it and see what I can see.

@ELD ELD changed the base branch from master to rocket-rc2-updates June 6, 2022 02:46
@ELD ELD merged commit 8b19ddb into lawliet89:rocket-rc2-updates Jun 6, 2022
@ELD
Copy link
Collaborator

ELD commented Jun 6, 2022

@secana I changed the base branch to my branch that includes updates to fix the linter and build errors. I merged your commit into it so as to not erase your contribution.

Thanks so much for the PR! 🙂

ELD added a commit that referenced this pull request Jun 6, 2022
* Update to work with latest Rocket RC

The following changes were made:
- Satisfying the `#[must_use]` annotation on the `Rocket` struct where
  necessary (mostly in test code)
- Adding the `http` crate for the `HeaderName` type
    - Rocket no longer exports all of `hyper` or `http`
      indescriminately, so we have to be more mindful of types from
      either crate that we require. Thus, this commit adds the `http`
      crate to satisfy the requirement.
- Updated tests to properly return a result from a launched `Rocket`

* remove not found __arg2 (#108)

* Fix various clippy lint errors on nightly

Co-authored-by: Stefan Hausotte <stefan.hausotte@gmx.de>
@secana
Copy link
Contributor Author

secana commented Jun 6, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants